<template>
	<view>
		<view v-show="downStatus" :style="{width:width+'rpx',left:left+'rpx',top: top +'rpx',right: right + 'rpx',buttom:buttom + 'rpx',}"
			class="down_list">
			<view @click="downMenuHandle(index)" :class="{'active' : activeDown == index}" v-for="(item, index) in list"
				:key="index">
				{{ item.label }}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			activeDown: {
				type: Number,
				value: 0,
			},
			list: {
				type: Array,
				value: []
			},
			downStatus: {
				type: Boolean,
				value: false
			},
			width:{
				type:String,
				value:"120"
			},
			left: {
				type: String,
				//  需要将父盒子定位为relative
			},
			right: {
				type: String,
			},
			buttom: {
				type: String,
			},
			top: {
				type: String,
			},
		},
		data() {
			return {
				// downStatus: false,
			};
		},
		methods: {
			downMenuHandle(index) {
				this.$emit('downCheckHandle', index)
			}
		}
	}
</script>

<style lang="less">
	.down_list {
		padding: 10rpx 0;
		box-sizing: border-box;
		z-index: 100;
		position: absolute;
		right: 0;
		top: 100rpx;
		background-color: #fff;
		border-radius: 10rpx;
		border: 2rpx solid #ededed;
	}

	.down_list .active {
		background-color: #0057ff;
		color: #fff;
	}

	.down_list view {
		padding: 0 25rpx;
		height: 70rpx;
		line-height: 70rpx;
	}
</style>